/* ***********************
 * Version: MPL 1.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is GetHttpObject.js module.
 *
 * The Initial Developer of the Original Code is Rob Gerns.
 *
 * Portions created by the Initial Developer are Copyright (C) 2010
 * the Initial Developer. All Rights Reserved.
 *
 **************************/
function getHttpObject() {
    /*************************************************
    * Function Name: getHttpObject
    *
    * Purpose:
    * Start the AJAX (Make a new XML HTTP Request).
    * This is a pretty standard way of doing this.
    **************************************************/
    var objXmlHttp = "";
    
    //set up a new AJAX HTTP request if browser is a non-Microsoft browser
    if (window.XMLHttpRequest) {
        objXmlHttp = new XMLHttpRequest();
    }  
    //Try for a Microsoft browser
    else if (window.ActiveXObject) {
        try {
        //Preferred method for Microsoft AJAX
        objXmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
        //Browsers that didn't support either method
        catch(e) {
            try {
            objXmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch(e) {
            document.write("Sorry, this browser isn't supported.");
            }
        }
    }
    if (objXmlHttp !== "") {
        return objXmlHttp;
    }
}